<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

// Route::get('/', function () {
//     return view('welcome');
// });

Auth::routes();

Route::get('home', 'HomeController@index')->name('home');



Route::prefix('admin')->middleware('auth')->group(function () {
    #轮播图
    Route::get('carousel/show', 'CarouselController@show')->name('carousel.show');
    Route::get('carousel/add', 'CarouselController@add')->name('carousel.add');
    Route::post('carousel/store', 'CarouselController@store')->name('carousel.store');
    Route::get('carousel/edit/{carousel}', 'CarouselController@edit')->name('carousel.edit');
    Route::post('carousel/{carousel}/update', 'CarouselController@update')->name('carousel.update');
    Route::get('carousel/{carousel}/delete', 'CarouselController@delete')->name('carousel.delete');

    #新闻
    Route::get('news/show', 'NewsController@show')->name('news.show');
    Route::get('news/add', 'NewsController@add')->name('news.add');
    Route::post('news/store', 'NewsController@store')->name('news.store');
    Route::get('news/{news}/edit', 'NewsController@edit')->name('news.edit');
    Route::post('news/{news}/update', 'NewsController@update')->name('news.update');
    Route::get('news/{news}/delete', 'NewsController@delete')->name('news.delete');

    #子页面
    Route::get('news/subpage/show', 'SubpageController@show')->name('subpage.show');
    Route::get('news/subpage/edit/{news}', 'SubpageController@edit')->name('subpage.edit');

    #留言
    Route::get('messages/show', 'MessagesController@show')->name('messages.show');
    Route::get('messages/delete/{msg}', 'MessagesController@delete')->name('messages.delete');
});

Route::post('test','SubpageController@update')->name('test');

#Ckeditor富文本官方上传配置
Route::group(['middleware' => 'auth'], function () {
    Route::get('/laravel-filemanager', '\UniSharp\LaravelFilemanager\Controllers\LfmController@show');
    Route::post('/laravel-filemanager/upload', '\UniSharp\LaravelFilemanager\Controllers\UploadController@upload');
});

//前端页面显示
    Route::get('/', 'Home\IndexController@index')->name('index.index');
    Route::get('overview', 'Home\IndexController@overview')->name('index.overview');
    Route::get('information', 'Home\IndexController@information')->name('index.information');
    Route::get('apply', 'Home\IndexController@apply')->name('index.apply');
    Route::get('work', 'Home\IndexController@work')->name('index.work');
    Route::get('member_service', 'Home\IndexController@member_service')->name('index.member_service');
    Route::get('member_exchange', 'Home\IndexController@member_exchange')->name('index.member_exchange');
    Route::get('message', 'Home\IndexController@message')->name('index.message');
    Route::post('message/store', 'Home\IndexController@message_store')->name('message.store');
    Route::get('article_detail/{article}', 'Home\IndexController@article_detail')->name('article_detail');
    Route::get('download_file', 'Home\IndexController@download_file')->name('download_file');


